﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
checkadmin(1)
dim act,id,specialname,specialengname,specialimg,visible,rst,sqlt,content_chn,content_eng, template,keyword_chn,keyword_eng, orders
act=request.Form("act")
id=request.Form("id")
specialname=HTMLEncode(request.Form("specialname"))
If (specialname="") Then
historygoback("请填写专题名称")
End If 
specialengname=HTMLEncode(request.Form("specialengname"))
specialimg=request.Form("specialimg")
visible=request.Form("visible")
If visible="" Or visible=null Then
	visible=0
Else
	visible=1
End If 
content_chn=request.Form("content_chn")
content_eng=request.Form("content_eng")
keyword_chn=HTMLEncode(request.Form("keyword_chn"))
keyword_eng=HTMLEncode(request.Form("keyword_eng"))
template=Trim(request.Form("template"))
orders=Trim(request.Form("orders"))
If content_chn<>"" Then
	content_chn=Replace(content_chn,"{","&#123;")
End If 
If content_eng<>"" Then
	content_eng=Replace(content_eng,"{","&#123;")
End If 
If act="add" Then 
	Set rst = Server.CreateObject("ADODB.Recordset")
	sqlt = "select * from [c_special]"
	rst.open sqlt,conn,1,3
	rst.addnew
	rst("specialname")=specialname
	rst("specialengname")=specialengname
	rst("specialimg")=specialimg
	rst("visible")=visible
	rst("content_chn")=content_chn
	rst("content_eng")=content_eng
	rst("keyword_chn")=keyword_chn
	rst("keyword_eng")=keyword_eng
	rst("template")=template
	rst("orders")=orders
	rst("modifytime")=Now()
	rst("hits")=0
	rst.update
	rst.close
	set rst=Nothing
	If app("rz_static")=1 Then
		response.write("<script type='text/javascript'>var flag;flag=confirm('您对专题进行了修改，您是否要更新相关HTML文件');")
		response.write("if(flag==true){location.href='makehtml.asp?onestep=1';}")
		response.write("else{location.href='showmsg.asp?from=special_list.asp&msg=AddSuccess';}")
		response.write("</script>")
	Else
	response.redirect("showmsg.asp?from=special_list.asp&msg=AddSuccess")
	End If 
end if 
If act="modify" Then 
	Set rst = Server.CreateObject("ADODB.Recordset")
	sqlt = "select * from [c_special] where id="&CInt(id)
	rst.open sqlt,conn,1,3
	rst("specialname")=specialname
	rst("specialengname")=specialengname
	rst("specialimg")=specialimg
	rst("visible")=visible
	rst("content_chn")=content_chn
	rst("content_eng")=content_eng
	rst("keyword_chn")=keyword_chn
	rst("keyword_eng")=keyword_eng
	rst("template")=template
	rst("orders")=orders
	rst("modifytime")=Now()
	rst.update
	rst.close
	set rst=Nothing
'	If app("rz_static")=1 Then
'		response.write("<script type='text/javascript'>var flag;flag=confirm('您对专题进行了修改，您'是否要更新相关HTML文件');")
'		response.write("if(flag==true){location.href='makehtml.asp?onestep=1';}")
'		response.write("else{location.href='showmsg.asp?from=special_list.asp&msg=ModifySuccess';}")
'		response.write("</script>")
'	Else
	response.redirect("showmsg.asp?from=special_list.asp&msg=ModifySuccess")
'	End If 	
end if 
%>